
#include "ogl/gut/MeshDesc1.h"
#include "ogl/gut/VertexArray.h"
#include "ogl/gut/Dictionary.h"
#include "imgui/custom/Editor.h"

using namespace Ogl::Gut;

template <>
bool ImGui::Editor::Edit(const std::string &label, Ogl::Gut::MeshDesc1::HD &inst)
{
    int index = 0;

    if (TreeNode(label.c_str(), inst.m_BitFlag, index++))
    {

        ComboInst<Ogl::Gut::VertexType, Ogl::Gut::VertexTypeDesc>("VertexType", Dictionary::m_VertexDescs, inst.m_VertexType);
        ComboInst<Ogl::Gut::IndexType, Ogl::Gut::IndexTypeDesc>("IndexType", Dictionary::m_IndexDescs, inst.m_IndexType);
        ComboInst<Ogl::Gut::ModeType, Ogl::Gut::ModeTypeDesc>("ModeType", Dictionary::m_ModeDescs, inst.m_ModeType);

        EditInst("numVertices", inst.m_NumVertices);
        EditInst("numIndices", inst.m_NumIndices);

        TreePop();
    }

    return false;
};


template <>
bool ImGui::Editor::Edit(const std::string &label, Ogl::Gut::MeshDesc1 &inst)
{
    int index = 0;

    if (TreeNode(label.c_str(), inst.m_BitFlag, index++))
    {
        EditInst("HD", inst.m_HD);
        TreePop();
    }

    return false;
};
